<template>
  <div class="item-input">
    <el-pagination
      @size-change="sizeChange"
      @current-change="currentChange"
      :current-page="page.currentPage"
      :page-sizes="page.pageSizes"
      :page-size="page.pageSize"
      :total="page.total"
      layout="total, sizes, prev, pager, next, jumper"
      style="
        display: flex;
        justify-content: flex-end;
        padding: 20px 0;
        box-sizing: border-box;
      "
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "CpmPagination",
  props: {
    page: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      // 表格配置
    };
  },
  methods: {
    /** 每页显示条数 */
    sizeChange(pageSize) {
      if (pageSize >= this.page.total) {
        this.currentChange(1);
      }
      this.$emit("size-change", pageSize);
    },
    /** 当前的页数 */
    currentChange(currentPage) {
      this.$emit("current-change", currentPage);
    },
  },
};
</script>


<style scoped lang="less">
</style>
